package com.xiaotu.observer.improve;

/**
 * @author 张晓
 * @create 2020-06-26 14:50
 */
public class Client {
    public static void main(String[] args) {
        //创建一个WeatherData
        WeatherData weatherData = new WeatherData();
        //创建一个观察者
        CurrentConditions currentConditions = new CurrentConditions();
        //百度网站
        BaiduSite baiduSite = new BaiduSite();
        //注册到WeatherData
        weatherData.registerObserver(currentConditions);
        weatherData.registerObserver(baiduSite);
        weatherData.removeObserver(currentConditions);
        //测试
        System.out.println(" 通知各个注册的观察者，看看信息 ");
        weatherData.setData(10f,100f,30.3f);
    }
}
